<template>
    <div class="box">
        <h1>Child1 - 接收数据</h1>
    </div>
</template>

<script>
import Pubsub from 'pubsub-js'
export default {
    name: "Child1",
    mounted() {
        Pubsub.subscribe('receiveData',this.receiveData)
    },
    methods: {
        receiveData(messageType, text) {
            console.log(messageType, text);
        }
    }
}
</script>

<style scoped>

</style>